﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bussiness.Service;
using Bussiness;

namespace ShoppingLinkBui.View.FrontEnd.UserControlls
{
    public partial class Vertical_Menu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack){
                loadVerticalmenu();
            }
        }

        public void loadVerticalmenu()
        {
          List<CateloriesProduct> listproduct =  new Catelogy_Service().getCatelogiesProductChild(3);
          for (int i = 0; i < listproduct.Count;i++ )
          {
              listShose.Text += "<li><a href='/Products/DanhSachSanPham/?ID_Catelogy=" + listproduct[i].ID + "&PageIndex=1'>" + listproduct[i].Name + "</a></li>";
          }
          listproduct =  new Catelogy_Service().getCatelogiesProductChild(9);
             for (int i = 0; i < listproduct.Count;i++ )
          {
              listBag.Text += "<li><a href='/Products/DanhSachSanPham/?ID_Catelogy=" + listproduct[i].ID + "&PageIndex=1'>" + listproduct[i].Name + "</a></li>";
          }
           
        }
    }
}